﻿using System;
using Unity.String.Number;
using Xunit;

namespace Unity.String.Tests.Number
{
    public class NumberWriterTest
    {
        [Fact]
        public void TryWriteInt64Test()
        {
            char[] testInt64Buffer = new char[1024];
            long testInt64Value = 123456789L;
            bool tryWriteIn64Result = NumberWriter.TryWriteInt64(testInt64Buffer.AsSpan(), 
                out int testInt64CharsWritten, testInt64Value);
            int needWrittenInt64Chars = 9;
            Assert.Equal(needWrittenInt64Chars, testInt64CharsWritten);
            Assert.True(tryWriteIn64Result);

            char[] testInt64BufferWithValueLength19Symbols = new char[1024];
            long testInt64WithValueLength19Symbols = long.MaxValue;
            bool tryWriteIn64WithValueLength19SymbolsResult = NumberWriter.TryWriteInt64(testInt64BufferWithValueLength19Symbols.AsSpan(), 
                out int testInt64ValueLength19SymbolsCharsWritten, testInt64WithValueLength19Symbols);
            int needWrittenInt64WithValueLength19SymbolsChars = 19;
            Assert.Equal(needWrittenInt64WithValueLength19SymbolsChars, testInt64ValueLength19SymbolsCharsWritten);
            Assert.True(tryWriteIn64WithValueLength19SymbolsResult);
            
            char[] testInt64BufferWithValueLength19SymbolsAndLessNeedBuffer = new char[18];
            long testInt64WithValueLength19SymbolsAndLessNeedBuffer = long.MaxValue;
            bool tryWriteIn64WithValueLength19SymbolsAndLessNeedBufferResult = NumberWriter.TryWriteInt64(testInt64BufferWithValueLength19SymbolsAndLessNeedBuffer.AsSpan(), 
                out int testInt64ValueLength19SymbolsAndLessNeedBufferCharsWritten, testInt64WithValueLength19SymbolsAndLessNeedBuffer);
            int needWrittenInt64WithValueLength19SymbolsAndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenInt64WithValueLength19SymbolsAndLessNeedBufferChars, testInt64ValueLength19SymbolsAndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueLength19SymbolsAndLessNeedBufferResult);
            
            char[] testInt64BufferWithValueLength18Symbols = new char[1024];
            long testInt64WithValueLength18Symbols = 987654321012345678L;
            bool tryWriteIn64WithValueLength18SymbolsResult = NumberWriter.TryWriteInt64(testInt64BufferWithValueLength18Symbols.AsSpan(), 
                out int testInt64ValueLength18SymbolsCharsWritten, testInt64WithValueLength18Symbols);
            int needWrittenInt64WithValueLength18SymbolsChars = 18;
            Assert.Equal(needWrittenInt64WithValueLength18SymbolsChars, testInt64ValueLength18SymbolsCharsWritten);
            Assert.True(tryWriteIn64WithValueLength18SymbolsResult);
            
            char[] testInt64BufferWithValueLength18SymbolsAndLessNeedBuffer = new char[17];
            long testInt64WithValueLength18SymbolsAndLessNeedBuffer = 987654321012345678L;
            bool tryWriteIn64WithValueLength18SymbolsAndLessNeedBufferResult = NumberWriter.TryWriteInt64(testInt64BufferWithValueLength18SymbolsAndLessNeedBuffer.AsSpan(), 
                out int testInt64ValueLength18SymbolsAndLessNeedBufferCharsWritten, testInt64WithValueLength18SymbolsAndLessNeedBuffer);
            int needWrittenInt64WithValueLength18SymbolsAndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenInt64WithValueLength18SymbolsAndLessNeedBufferChars, testInt64ValueLength18SymbolsAndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueLength18SymbolsAndLessNeedBufferResult);
            
            char[] testInt64BufferWithValueLength17Symbols = new char[1024];
            long testInt64WithValueLength17Symbols = 98765432101234567L;
            bool tryWriteIn64WithValueLength17SymbolsResult = NumberWriter.TryWriteInt64(testInt64BufferWithValueLength17Symbols.AsSpan(), 
                out int testInt64ValueLength17SymbolsCharsWritten, testInt64WithValueLength17Symbols);
            int needWrittenInt64WithValueLength17SymbolsChars = 17;
            Assert.Equal(needWrittenInt64WithValueLength17SymbolsChars, testInt64ValueLength17SymbolsCharsWritten);
            Assert.True(tryWriteIn64WithValueLength17SymbolsResult);
            
            char[] testInt64BufferWithValueLength17SymbolsAndLessNeedBuffer = new char[16];
            long testInt64WithValueLength17SymbolsAndLessNeedBuffer = 98765432101234567L;
            bool tryWriteIn64WithValueLength17SymbolsAndLessNeedBufferResult = NumberWriter.TryWriteInt64(testInt64BufferWithValueLength17SymbolsAndLessNeedBuffer.AsSpan(), 
                out int testInt64ValueLength17SymbolsAndLessNeedBufferCharsWritten, testInt64WithValueLength17SymbolsAndLessNeedBuffer);
            int needWrittenInt64WithValueLength17SymbolsAndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenInt64WithValueLength17SymbolsAndLessNeedBufferChars, testInt64ValueLength17SymbolsAndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueLength17SymbolsAndLessNeedBufferResult);
            
            char[] testInt64BufferWithValueLength16Symbols = new char[1024];
            long testInt64WithValueLength16Symbols = 9876543210123456L;
            bool tryWriteIn64WithValueLength16SymbolsResult = NumberWriter.TryWriteInt64(testInt64BufferWithValueLength16Symbols.AsSpan(), 
                out int testInt64ValueLength16SymbolsCharsWritten, testInt64WithValueLength16Symbols);
            int needWrittenInt64WithValueLength16SymbolsChars = 16;
            Assert.Equal(needWrittenInt64WithValueLength16SymbolsChars, testInt64ValueLength16SymbolsCharsWritten);
            Assert.True(tryWriteIn64WithValueLength16SymbolsResult);
            
            char[] testInt64BufferWithValueLength16SymbolsAndLessNeedBuffer = new char[15];
            long testInt64WithValueLength16SymbolsAndLessNeedBuffer = 9876543210123456L;
            bool tryWriteIn64WithValueLength16SymbolsAndLessNeedBufferResult = NumberWriter.TryWriteInt64(testInt64BufferWithValueLength16SymbolsAndLessNeedBuffer.AsSpan(), 
                out int testInt64ValueLength16SymbolsAndLessNeedBufferCharsWritten, testInt64WithValueLength16SymbolsAndLessNeedBuffer);
            int needWrittenInt64WithValueLength16SymbolsAndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenInt64WithValueLength16SymbolsAndLessNeedBufferChars, testInt64ValueLength16SymbolsAndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueLength16SymbolsAndLessNeedBufferResult);
            
            char[] testInt64BufferWithValueLength15Symbols = new char[1024];
            long testInt64WithValueLength15Symbols = 987654321012345L;
            bool tryWriteIn64WithValueLength15SymbolsResult = NumberWriter.TryWriteInt64(testInt64BufferWithValueLength15Symbols.AsSpan(), 
                out int testInt64ValueLength15SymbolsCharsWritten, testInt64WithValueLength15Symbols);
            int needWrittenInt64WithValueLength15SymbolsChars = 15;
            Assert.Equal(needWrittenInt64WithValueLength15SymbolsChars, testInt64ValueLength15SymbolsCharsWritten);
            Assert.True(tryWriteIn64WithValueLength15SymbolsResult);
            
            char[] testInt64BufferWithValueLength15SymbolsAndLessNeedBuffer = new char[14];
            long testInt64WithValueLength15SymbolsAndLessNeedBuffer = 987654321012345L;
            bool tryWriteIn64WithValueLength15SymbolsAndLessNeedBufferResult = NumberWriter.TryWriteInt64(testInt64BufferWithValueLength15SymbolsAndLessNeedBuffer.AsSpan(), 
                out int testInt64ValueLength15SymbolsAndLessNeedBufferCharsWritten, testInt64WithValueLength15SymbolsAndLessNeedBuffer);
            int needWrittenInt64WithValueLength15SymbolsAndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenInt64WithValueLength15SymbolsAndLessNeedBufferChars, testInt64ValueLength15SymbolsAndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueLength15SymbolsAndLessNeedBufferResult);
            
            char[] testInt64BufferWithValueLength14Symbols = new char[1024];
            long testInt64WithValueLength14Symbols = 98765432101234L;
            bool tryWriteIn64WithValueLength14SymbolsResult = NumberWriter.TryWriteInt64(testInt64BufferWithValueLength14Symbols.AsSpan(), 
                out int testInt64ValueLength14SymbolsCharsWritten, testInt64WithValueLength14Symbols);
            int needWrittenInt64WithValueLength14SymbolsChars = 14;
            Assert.Equal(needWrittenInt64WithValueLength14SymbolsChars, testInt64ValueLength14SymbolsCharsWritten);
            Assert.True(tryWriteIn64WithValueLength14SymbolsResult);
            
            char[] testInt64BufferWithValueLength14SymbolsAndLessNeedBuffer = new char[13];
            long testInt64WithValueLength14SymbolsAndLessNeedBuffer = 98765432101234L;
            bool tryWriteIn64WithValueLength14SymbolsAndLessNeedBufferResult = NumberWriter.TryWriteInt64(testInt64BufferWithValueLength14SymbolsAndLessNeedBuffer.AsSpan(), 
                out int testInt64ValueLength14SymbolsAndLessNeedBufferCharsWritten, testInt64WithValueLength14SymbolsAndLessNeedBuffer);
            int needWrittenInt64WithValueLength14SymbolsAndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenInt64WithValueLength14SymbolsAndLessNeedBufferChars, testInt64ValueLength14SymbolsAndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueLength14SymbolsAndLessNeedBufferResult);
            
            char[] testInt64BufferWithValueLength13Symbols = new char[1024];
            long testInt64WithValueLength13Symbols = 9876543210123L;
            bool tryWriteIn64WithValueLength13SymbolsResult = NumberWriter.TryWriteInt64(testInt64BufferWithValueLength13Symbols.AsSpan(), 
                out int testInt64ValueLength13SymbolsCharsWritten, testInt64WithValueLength13Symbols);
            int needWrittenInt64WithValueLength13SymbolsChars = 13;
            Assert.Equal(needWrittenInt64WithValueLength13SymbolsChars, testInt64ValueLength13SymbolsCharsWritten);
            Assert.True(tryWriteIn64WithValueLength13SymbolsResult);
            
            char[] testInt64BufferWithValueLength13SymbolsAndLessNeedBuffer = new char[12];
            long testInt64WithValueLength13SymbolsAndLessNeedBuffer = 9876543210123L;
            bool tryWriteIn64WithValueLength13SymbolsAndLessNeedBufferResult = NumberWriter.TryWriteInt64(testInt64BufferWithValueLength13SymbolsAndLessNeedBuffer.AsSpan(), 
                out int testInt64ValueLength13SymbolsAndLessNeedBufferCharsWritten, testInt64WithValueLength13SymbolsAndLessNeedBuffer);
            int needWrittenInt64WithValueLength13SymbolsAndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenInt64WithValueLength13SymbolsAndLessNeedBufferChars, testInt64ValueLength13SymbolsAndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueLength13SymbolsAndLessNeedBufferResult);
            
            char[] testInt64BufferWithValueLength12Symbols = new char[1024];
            long testInt64WithValueLength12Symbols = 987654321012L;
            bool tryWriteIn64WithValueLength12SymbolsResult = NumberWriter.TryWriteInt64(testInt64BufferWithValueLength12Symbols.AsSpan(), 
                out int testInt64ValueLength12SymbolsCharsWritten, testInt64WithValueLength12Symbols);
            int needWrittenInt64WithValueLength12SymbolsChars = 12;
            Assert.Equal(needWrittenInt64WithValueLength12SymbolsChars, testInt64ValueLength12SymbolsCharsWritten);
            Assert.True(tryWriteIn64WithValueLength12SymbolsResult);
            
            char[] testInt64BufferWithValueLength12SymbolsAndLessNeedBuffer = new char[11];
            long testInt64WithValueLength12SymbolsAndLessNeedBuffer = 987654321012L;
            bool tryWriteIn64WithValueLength12SymbolsAndLessNeedBufferResult = NumberWriter.TryWriteInt64(testInt64BufferWithValueLength12SymbolsAndLessNeedBuffer.AsSpan(), 
                out int testInt64ValueLength12SymbolsAndLessNeedBufferCharsWritten, testInt64WithValueLength12SymbolsAndLessNeedBuffer);
            int needWrittenInt64WithValueLength12SymbolsAndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenInt64WithValueLength12SymbolsAndLessNeedBufferChars, testInt64ValueLength12SymbolsAndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueLength12SymbolsAndLessNeedBufferResult);
            
            char[] testInt64BufferWithValueLength11Symbols = new char[1024];
            long testInt64WithValueLength11Symbols = 98765432101L;
            bool tryWriteIn64WithValueLength11SymbolsResult = NumberWriter.TryWriteInt64(testInt64BufferWithValueLength11Symbols.AsSpan(), 
                out int testInt64ValueLength11SymbolsCharsWritten, testInt64WithValueLength11Symbols);
            int needWrittenInt64WithValueLength11SymbolsChars = 11;
            Assert.Equal(needWrittenInt64WithValueLength11SymbolsChars, testInt64ValueLength11SymbolsCharsWritten);
            Assert.True(tryWriteIn64WithValueLength11SymbolsResult);
            
            char[] testInt64BufferWithValueLength11SymbolsAndLessNeedBuffer = new char[10];
            long testInt64WithValueLength11SymbolsAndLessNeedBuffer = 98765432101L;
            bool tryWriteIn64WithValueLength11SymbolsAndLessNeedBufferResult = NumberWriter.TryWriteInt64(testInt64BufferWithValueLength11SymbolsAndLessNeedBuffer.AsSpan(), 
                out int testInt64ValueLength11SymbolsAndLessNeedBufferCharsWritten, testInt64WithValueLength11SymbolsAndLessNeedBuffer);
            int needWrittenInt64WithValueLength11SymbolsAndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenInt64WithValueLength11SymbolsAndLessNeedBufferChars, testInt64ValueLength11SymbolsAndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueLength11SymbolsAndLessNeedBufferResult);
            
            char[] testInt64BufferWithValueLength10Symbols = new char[1024];
            long testInt64WithValueLength10Symbols = 9876543210L;
            bool tryWriteIn64WithValueLength10SymbolsResult = NumberWriter.TryWriteInt64(testInt64BufferWithValueLength10Symbols.AsSpan(), 
                out int testInt64ValueLength10SymbolsCharsWritten, testInt64WithValueLength10Symbols);
            int needWrittenInt64WithValueLength10SymbolsChars = 10;
            Assert.Equal(needWrittenInt64WithValueLength10SymbolsChars, testInt64ValueLength10SymbolsCharsWritten);
            Assert.True(tryWriteIn64WithValueLength10SymbolsResult);
            
            char[] testInt64BufferWithValueLength10SymbolsAndLessNeedBuffer = new char[9];
            long testInt64WithValueLength10SymbolsAndLessNeedBuffer = 9876543210L;
            bool tryWriteIn64WithValueLength10SymbolsAndLessNeedBufferResult = NumberWriter.TryWriteInt64(testInt64BufferWithValueLength10SymbolsAndLessNeedBuffer.AsSpan(), 
                out int testInt64ValueLength10SymbolsAndLessNeedBufferCharsWritten, testInt64WithValueLength10SymbolsAndLessNeedBuffer);
            int needWrittenInt64WithValueLength10SymbolsAndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenInt64WithValueLength10SymbolsAndLessNeedBufferChars, testInt64ValueLength10SymbolsAndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueLength10SymbolsAndLessNeedBufferResult);
            
            char[] testInt64BufferWithValueMore100000000 = new char[1024];
            long testInt64WithValueMore100000000 = 987654321L;
            bool tryWriteIn64WithValueMore100000000Result = NumberWriter.TryWriteInt64(testInt64BufferWithValueMore100000000.AsSpan(), 
                out int testInt64ValueMore100000000CharsWritten, testInt64WithValueMore100000000);
            int needWrittenInt64WithValueMore100000000Chars = 9;
            Assert.Equal(needWrittenInt64WithValueMore100000000Chars, testInt64ValueMore100000000CharsWritten);
            Assert.True(tryWriteIn64WithValueMore100000000Result);
            
            char[] testInt64BufferWithValueMore100000000AndLessNeedBuffer = new char[8];
            long testInt64WithValueMore100000000AndLessNeedBuffer = 987654321L;
            bool tryWriteIn64WithValueMore100000000AndLessNeedBufferResult = NumberWriter.TryWriteInt64(testInt64BufferWithValueMore100000000AndLessNeedBuffer.AsSpan(), 
                out int testInt64ValueMore100000000AndLessNeedBufferCharsWritten, testInt64WithValueMore100000000AndLessNeedBuffer);
            int needWrittenInt64WithValueMore100000000AndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenInt64WithValueMore100000000AndLessNeedBufferChars, testInt64ValueMore100000000AndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueMore100000000AndLessNeedBufferResult);
            
            char[] testInt64BufferWithValueMore10000000 = new char[1024];
            long testInt64WithValueMore10000000 = 98765432L;
            bool tryWriteIn64WithValueMore10000000Result = NumberWriter.TryWriteInt64(testInt64BufferWithValueMore10000000.AsSpan(), 
                out int testInt64ValueMore10000000CharsWritten, testInt64WithValueMore10000000);
            int needWrittenInt64WithValueMore10000000Chars = 8;
            Assert.Equal(needWrittenInt64WithValueMore10000000Chars, testInt64ValueMore10000000CharsWritten);
            Assert.True(tryWriteIn64WithValueMore10000000Result);
            
            char[] testInt64BufferWithValueMore10000000AndLessNeedBuffer = new char[7];
            long testInt64WithValueMore10000000AndLessNeedBuffer = 98765432L;
            bool tryWriteIn64WithValueMore10000000AndLessNeedBufferResult = NumberWriter.TryWriteInt64(testInt64BufferWithValueMore10000000AndLessNeedBuffer.AsSpan(), 
                out int testInt64ValueMore10000000AndLessNeedBufferCharsWritten, testInt64WithValueMore10000000AndLessNeedBuffer);
            int needWrittenInt64WithValueMore10000000AndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenInt64WithValueMore10000000AndLessNeedBufferChars, testInt64ValueMore10000000AndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueMore10000000AndLessNeedBufferResult);
            
            char[] testInt64BufferWithValueMore1000000 = new char[1024];
            long testInt64WithValueMore1000000 = 9876543L;
            bool tryWriteIn64WithValueMore1000000Result = NumberWriter.TryWriteInt64(testInt64BufferWithValueMore1000000.AsSpan(), 
                out int testInt64ValueMore1000000CharsWritten, testInt64WithValueMore1000000);
            int needWrittenInt64WithValueMore1000000Chars = 7;
            Assert.Equal(needWrittenInt64WithValueMore1000000Chars, testInt64ValueMore1000000CharsWritten);
            Assert.True(tryWriteIn64WithValueMore1000000Result);
            
            char[] testInt64BufferWithValueMore1000000AndLessNeedBuffer = new char[6];
            long testInt64WithValueMore1000000AndLessNeedBuffer = 9876543L;
            bool tryWriteIn64WithValueMore1000000AndLessNeedBufferResult = NumberWriter.TryWriteInt64(testInt64BufferWithValueMore1000000AndLessNeedBuffer.AsSpan(), 
                out int testInt64ValueMore1000000AndLessNeedBufferCharsWritten, testInt64WithValueMore1000000AndLessNeedBuffer);
            int needWrittenInt64WithValueMore1000000AndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenInt64WithValueMore1000000AndLessNeedBufferChars, testInt64ValueMore1000000AndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueMore1000000AndLessNeedBufferResult);
            
            char[] testInt64BufferWithValueMore100000 = new char[1024];
            long testInt64WithValueMore100000 = 987654L;
            bool tryWriteIn64WithValueMore100000Result = NumberWriter.TryWriteInt64(testInt64BufferWithValueMore100000.AsSpan(), 
                out int testInt64ValueMore100000CharsWritten, testInt64WithValueMore100000);
            int needWrittenInt64WithValueMore100000Chars = 6;
            Assert.Equal(needWrittenInt64WithValueMore100000Chars, testInt64ValueMore100000CharsWritten);
            Assert.True(tryWriteIn64WithValueMore100000Result);
            
            char[] testInt64BufferWithValueMore100000AndLessNeedBuffer = new char[5];
            long testInt64WithValueMore100000AndLessNeedBuffer = 987654L;
            bool tryWriteIn64WithValueMore100000AndLessNeedBufferResult = NumberWriter.TryWriteInt64(testInt64BufferWithValueMore100000AndLessNeedBuffer.AsSpan(), 
                out int testInt64ValueMore100000AndLessNeedBufferCharsWritten, testInt64WithValueMore100000AndLessNeedBuffer);
            int needWrittenInt64WithValueMore100000AndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenInt64WithValueMore100000AndLessNeedBufferChars, testInt64ValueMore100000AndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueMore100000AndLessNeedBufferResult);
            
            char[] testInt64BufferWithValueMore10000 = new char[1024];
            long testInt64WithValueMore10000 = 98765L;
            bool tryWriteIn64WithValueMore10000Result = NumberWriter.TryWriteInt64(testInt64BufferWithValueMore10000.AsSpan(), 
                out int testInt64ValueMore10000CharsWritten, testInt64WithValueMore10000);
            int needWrittenInt64WithValueMore10000Chars = 5;
            Assert.Equal(needWrittenInt64WithValueMore10000Chars, testInt64ValueMore10000CharsWritten);
            Assert.True(tryWriteIn64WithValueMore10000Result);
            
            char[] testInt64BufferWithValueMore10000AndLessNeedBuffer = new char[4];
            long testInt64WithValueMore10000AndLessNeedBuffer = 98765L;
            bool tryWriteIn64WithValueMore10000AndLessNeedBufferResult = NumberWriter.TryWriteInt64(testInt64BufferWithValueMore10000AndLessNeedBuffer.AsSpan(), 
                out int testInt64ValueMore10000AndLessNeedBufferCharsWritten, testInt64WithValueMore10000AndLessNeedBuffer);
            int needWrittenInt64WithValueMore10000AndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenInt64WithValueMore10000AndLessNeedBufferChars, testInt64ValueMore10000AndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueMore10000AndLessNeedBufferResult);

            char[] testInt64BufferWithValueLess10000AndEmptyBuffer = Array.Empty<char>();
            long testInt64WithValueLess10000AndEmptyBuffer = 9876L;
            bool tryWriteIn64WithValueLess10000AndEmptyBufferResult = NumberWriter.TryWriteInt64(testInt64BufferWithValueLess10000AndEmptyBuffer.AsSpan(), 
                out int testInt64ValueLess10000AndEmptyBufferCharsWritten, testInt64WithValueLess10000AndEmptyBuffer);
            int needWrittenInt64WithValueLess10000AndEmptyBufferChars = 0;
            Assert.Equal(needWrittenInt64WithValueLess10000AndEmptyBufferChars, testInt64ValueLess10000AndEmptyBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueLess10000AndEmptyBufferResult);
            
            char[] testInt64BufferWithValueLess10000 = new char[1024];
            long testInt64WithValueLess10000 = 9876L;
            bool tryWriteIn64WithValueLess10000Result = NumberWriter.TryWriteInt64(testInt64BufferWithValueLess10000.AsSpan(), 
                out int testInt64ValueLess10000CharsWritten, testInt64WithValueLess10000);
            int needWrittenInt64WithValueLess10000Chars = 4;
            Assert.Equal(needWrittenInt64WithValueLess10000Chars, testInt64ValueLess10000CharsWritten);
            Assert.True(tryWriteIn64WithValueLess10000Result);
            
            char[] testInt64BufferWithValueLess1000 = new char[1024];
            long testInt64WithValueLess1000 = 987L;
            bool tryWriteIn64WithValueLess1000Result = NumberWriter.TryWriteInt64(testInt64BufferWithValueLess1000.AsSpan(), 
                out int testInt64ValueLess1000CharsWritten, testInt64WithValueLess1000);
            int needWrittenInt64WithValueLess1000Chars = 3;
            Assert.Equal(needWrittenInt64WithValueLess1000Chars, testInt64ValueLess1000CharsWritten);
            Assert.True(tryWriteIn64WithValueLess1000Result);
            
            char[] testInt64BufferWithValueLess1000AndLessNeedBuffer = new char[2];
            long testInt64WithValueLess1000AndLessNeedBuffer = 987L;
            bool tryWriteIn64WithValueLess1000AndLessNeedBufferResult = NumberWriter.TryWriteInt64(testInt64BufferWithValueLess1000AndLessNeedBuffer.AsSpan(), 
                out int testInt64ValueLess1000AndLessNeedBufferCharsWritten, testInt64WithValueLess1000AndLessNeedBuffer);
            int needWrittenInt64WithValueLess1000AndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenInt64WithValueLess1000AndLessNeedBufferChars, testInt64ValueLess1000AndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueLess1000AndLessNeedBufferResult);
            
            char[] testInt64BufferWithValueLess100 = new char[1024];
            long testInt64WithValueLess100 = 98L;
            bool tryWriteIn64WithValueLess100Result = NumberWriter.TryWriteInt64(testInt64BufferWithValueLess100.AsSpan(), 
                out int testInt64ValueLess100CharsWritten, testInt64WithValueLess100);
            int needWrittenInt64WithValueLess100Chars = 2;
            Assert.Equal(needWrittenInt64WithValueLess100Chars, testInt64ValueLess100CharsWritten);
            Assert.True(tryWriteIn64WithValueLess100Result);
            
            char[] testInt64BufferWithValueLess100AndLessNeedBuffer = new char[1];
            long testInt64WithValueLess100AndLessNeedBuffer = 98L;
            bool tryWriteIn64WithValueLess100AndLessNeedBufferResult = NumberWriter.TryWriteInt64(testInt64BufferWithValueLess100AndLessNeedBuffer.AsSpan(), 
                out int testInt64ValueLess100AndLessNeedBufferCharsWritten, testInt64WithValueLess100AndLessNeedBuffer);
            int needWrittenInt64WithValueLess100AndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenInt64WithValueLess100AndLessNeedBufferChars, testInt64ValueLess100AndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueLess100AndLessNeedBufferResult);
            
            char[] testInt64BufferWithValueLess10 = new char[1024];
            long testInt64WithValueLess10 = 9L;
            bool tryWriteIn64WithValueLess10Result = NumberWriter.TryWriteInt64(testInt64BufferWithValueLess10.AsSpan(), 
                out int testInt64ValueLess10CharsWritten, testInt64WithValueLess10);
            int needWrittenInt64WithValueLess10Chars = 1;
            Assert.Equal(needWrittenInt64WithValueLess10Chars, testInt64ValueLess10CharsWritten);
            Assert.True(tryWriteIn64WithValueLess10Result);
            
            char[] testInt64BufferWithValueLess10AndLessNeedBuffer = Array.Empty<char>();
            long testInt64WithValueLess10AndLessNeedBuffer = 9L;
            bool tryWriteIn64WithValueLess10AndLessNeedBufferResult = NumberWriter.TryWriteInt64(testInt64BufferWithValueLess10AndLessNeedBuffer.AsSpan(), 
                out int testInt64ValueLess10AndLessNeedBufferCharsWritten, testInt64WithValueLess10AndLessNeedBuffer);
            int needWrittenInt64WithValueLess10AndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenInt64WithValueLess10AndLessNeedBufferChars, testInt64ValueLess10AndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueLess10AndLessNeedBufferResult);
            
            char[] testInt64WithEmptyBuffer = Array.Empty<char>();
            long testInt64ValueWithEmptyBuffer = 123456789L;
            bool tryWriteIn64WithEmptyBufferResult = NumberWriter.TryWriteInt64(
                testInt64WithEmptyBuffer.AsSpan(), 
                out int testInt64WithEmptyBufferCharsWritten, testInt64ValueWithEmptyBuffer);
            int needWrittenInt64WithEmptyBufferChars = 0;
            Assert.Equal(needWrittenInt64WithEmptyBufferChars, testInt64WithEmptyBufferCharsWritten);
            Assert.False(tryWriteIn64WithEmptyBufferResult);
            
            char[] testNegativeInt64Buffer = new char[1024];
            long testNegativeInt64Value = -123456789L;
            bool tryWriteNegativeIn64Result = NumberWriter.TryWriteInt64(testNegativeInt64Buffer.AsSpan(), 
                out int testNegativeInt64CharsWritten, testNegativeInt64Value);
            int needWrittenNegativeInt64Chars = 10;
            Assert.Equal(needWrittenNegativeInt64Chars, testNegativeInt64CharsWritten);
            Assert.True(tryWriteNegativeIn64Result);
            
            char[] testNegativeInt64WithEmptyBuffer = Array.Empty<char>();
            long testNegativeInt64WithEmptyBufferValue = -123456789L;
            bool tryWriteNegativeIn64WithEmptyBufferResult = NumberWriter.TryWriteInt64(testNegativeInt64WithEmptyBuffer.AsSpan(), 
                out int testNegativeInt64WithEmptyBufferCharsWritten, testNegativeInt64WithEmptyBufferValue);
            int needWrittenNegativeInt64WithEmptyBufferChars = 0;
            Assert.Equal(needWrittenNegativeInt64WithEmptyBufferChars, testNegativeInt64WithEmptyBufferCharsWritten);
            Assert.False(tryWriteNegativeIn64WithEmptyBufferResult);
            
            char[] testMinValueInt64Buffer = new char[1024];
            long testMinValueInt64Value = long.MinValue;
            bool tryWriteMinValueIn64Result = NumberWriter.TryWriteInt64(testMinValueInt64Buffer.AsSpan(), 
                out int testMinValueInt64CharsWritten, testMinValueInt64Value);
            int needWrittenMinValueInt64Chars = 20;
            Assert.Equal(needWrittenMinValueInt64Chars, testMinValueInt64CharsWritten);
            Assert.True(tryWriteMinValueIn64Result);

            char[] testMinValueInt64AndEmptyBuffer = Array.Empty<char>();
            long testMinValueInt64ValueAndEmptyBuffer = long.MinValue;
            bool tryWriteMinValueWithAndEmptyBufferIn64Result = 
                NumberWriter.TryWriteInt64(testMinValueInt64AndEmptyBuffer.AsSpan(), 
                out int testMinValueWithAndEmptyBufferInt64CharsWritten, testMinValueInt64ValueAndEmptyBuffer);
            int needWrittenMinValueWithAndEmptyBufferInt64Chars = 0;
            Assert.Equal(needWrittenMinValueWithAndEmptyBufferInt64Chars, testMinValueWithAndEmptyBufferInt64CharsWritten);
            Assert.False(tryWriteMinValueWithAndEmptyBufferIn64Result);
            
            char[] testMinValueInt64AndLessNeedBuffer = new char[19];
            long testMinValueInt64ValueAndLessNeedBuffer = long.MinValue;
            bool tryWriteMinValueWithAndLessNeedBufferIn64Result = 
                NumberWriter.TryWriteInt64(testMinValueInt64AndLessNeedBuffer.AsSpan(), 
                    out int testMinValueWithAndLessNeedBufferInt64CharsWritten, testMinValueInt64ValueAndLessNeedBuffer);
            int needWrittenMinValueWithAndLessNeedBufferInt64Chars = 0;
            Assert.Equal(needWrittenMinValueWithAndLessNeedBufferInt64Chars, testMinValueWithAndLessNeedBufferInt64CharsWritten);
            Assert.False(tryWriteMinValueWithAndLessNeedBufferIn64Result);
            
            char[] testMaxValueInt64Buffer = new char[1024];
            long testMaxValueInt64Value = long.MaxValue;
            bool tryWriteMaxValueIn64Result = NumberWriter.TryWriteInt64(testMaxValueInt64Buffer.AsSpan(), 
                out int testMaxValueInt64CharsWritten, testMaxValueInt64Value);
            int needWrittenMaxValueInt64Chars = 19;
            Assert.Equal(needWrittenMaxValueInt64Chars, testMaxValueInt64CharsWritten);
            Assert.True(tryWriteMaxValueIn64Result);
            
            char[] testMaxValueInt64AndLessNeedBuffer = Array.Empty<char>();
            long testMaxValueInt64AndLessNeedBufferValue = long.MaxValue;
            bool tryWriteMaxValueAndLessNeedBufferIn64Result = 
                NumberWriter.TryWriteInt64(testMaxValueInt64AndLessNeedBuffer.AsSpan(), 
                    out int testMaxValueAndLessNeedBufferInt64CharsWritten, testMaxValueInt64AndLessNeedBufferValue);
            int needWrittenMaxValueAndLessNeedBufferInt64Chars = 0;
            Assert.Equal(needWrittenMaxValueAndLessNeedBufferInt64Chars, testMaxValueAndLessNeedBufferInt64CharsWritten);
            Assert.False(tryWriteMaxValueAndLessNeedBufferIn64Result);
        }
        
        [Fact]
        public void TryWriteUnsignedInt64Test()
        {
            char[] testUnsignedInt64Buffer = new char[1024];
            ulong testUnsignedInt64Value = 123456789L;
            bool tryWriteIn64Result = NumberWriter.TryWriteUInt64(testUnsignedInt64Buffer.AsSpan(), 
                out int testUnsignedInt64CharsWritten, testUnsignedInt64Value);
            int needWrittenUnsignedInt64Chars = 9;
            Assert.Equal(needWrittenUnsignedInt64Chars, testUnsignedInt64CharsWritten);
            Assert.True(tryWriteIn64Result);
            
            char[] testUnsignedInt64BufferWithValueLength20Symbols = new char[1024];
            ulong testUnsignedInt64WithValueLength20Symbols = ulong.MaxValue;
            bool tryWriteIn64WithValueLength20SymbolsResult = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueLength20Symbols.AsSpan(), 
                out int testUnsignedInt64ValueLength20SymbolsCharsWritten, testUnsignedInt64WithValueLength20Symbols);
            int needWrittenUnsignedInt64WithValueLength20SymbolsChars = 20;
            Assert.Equal(needWrittenUnsignedInt64WithValueLength20SymbolsChars, testUnsignedInt64ValueLength20SymbolsCharsWritten);
            Assert.True(tryWriteIn64WithValueLength20SymbolsResult);
            
            char[] testUnsignedInt64BufferWithValueLength20SymbolsAndLessNeedBuffer = new char[19];
            ulong testUnsignedInt64WithValueLength20SymbolsAndLessNeedBuffer = ulong.MaxValue;
            bool tryWriteIn64WithValueLength20SymbolsAndLessNeedBufferResult = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueLength20SymbolsAndLessNeedBuffer.AsSpan(), 
                out int testUnsignedInt64ValueLength20SymbolsAndLessNeedBufferCharsWritten, testUnsignedInt64WithValueLength20SymbolsAndLessNeedBuffer);
            int needWrittenUnsignedInt64WithValueLength20SymbolsAndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenUnsignedInt64WithValueLength20SymbolsAndLessNeedBufferChars, testUnsignedInt64ValueLength20SymbolsAndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueLength20SymbolsAndLessNeedBufferResult);
            
            char[] testUnsignedInt64BufferWithValueLength19Symbols = new char[1024];
            ulong testUnsignedInt64WithValueLength19Symbols = 9876543210123456789UL;
            bool tryWriteIn64WithValueLength19SymbolsResult = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueLength19Symbols.AsSpan(), 
                out int testUnsignedInt64ValueLength19SymbolsCharsWritten, testUnsignedInt64WithValueLength19Symbols);
            int needWrittenUnsignedInt64WithValueLength19SymbolsChars = 19;
            Assert.Equal(needWrittenUnsignedInt64WithValueLength19SymbolsChars, testUnsignedInt64ValueLength19SymbolsCharsWritten);
            Assert.True(tryWriteIn64WithValueLength19SymbolsResult);
            
            char[] testUnsignedInt64BufferWithValueLength19SymbolsAndLessNeedBuffer = new char[18];
            ulong testUnsignedInt64WithValueLength19SymbolsAndLessNeedBuffer = 9876543210123456789UL;
            bool tryWriteIn64WithValueLength19SymbolsAndLessNeedBufferResult = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueLength19SymbolsAndLessNeedBuffer.AsSpan(), 
                out int testUnsignedInt64ValueLength19SymbolsAndLessNeedBufferCharsWritten, testUnsignedInt64WithValueLength19SymbolsAndLessNeedBuffer);
            int needWrittenUnsignedInt64WithValueLength19SymbolsAndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenUnsignedInt64WithValueLength19SymbolsAndLessNeedBufferChars, testUnsignedInt64ValueLength19SymbolsAndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueLength19SymbolsAndLessNeedBufferResult);
            
            char[] testUnsignedInt64BufferWithValueLength18Symbols = new char[1024];
            ulong testUnsignedInt64WithValueLength18Symbols = 987654321012345678L;
            bool tryWriteIn64WithValueLength18SymbolsResult = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueLength18Symbols.AsSpan(), 
                out int testUnsignedInt64ValueLength18SymbolsCharsWritten, testUnsignedInt64WithValueLength18Symbols);
            int needWrittenUnsignedInt64WithValueLength18SymbolsChars = 18;
            Assert.Equal(needWrittenUnsignedInt64WithValueLength18SymbolsChars, testUnsignedInt64ValueLength18SymbolsCharsWritten);
            Assert.True(tryWriteIn64WithValueLength18SymbolsResult);
            
            char[] testUnsignedInt64BufferWithValueLength18SymbolsAndLessNeedBuffer = new char[17];
            ulong testUnsignedInt64WithValueLength18SymbolsAndLessNeedBuffer = 987654321012345678L;
            bool tryWriteIn64WithValueLength18SymbolsAndLessNeedBufferResult = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueLength18SymbolsAndLessNeedBuffer.AsSpan(), 
                out int testUnsignedInt64ValueLength18SymbolsAndLessNeedBufferCharsWritten, testUnsignedInt64WithValueLength18SymbolsAndLessNeedBuffer);
            int needWrittenUnsignedInt64WithValueLength18SymbolsAndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenUnsignedInt64WithValueLength18SymbolsAndLessNeedBufferChars, testUnsignedInt64ValueLength18SymbolsAndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueLength18SymbolsAndLessNeedBufferResult);
            
            char[] testUnsignedInt64BufferWithValueLength17Symbols = new char[1024];
            ulong testUnsignedInt64WithValueLength17Symbols = 98765432101234567L;
            bool tryWriteIn64WithValueLength17SymbolsResult = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueLength17Symbols.AsSpan(), 
                out int testUnsignedInt64ValueLength17SymbolsCharsWritten, testUnsignedInt64WithValueLength17Symbols);
            int needWrittenUnsignedInt64WithValueLength17SymbolsChars = 17;
            Assert.Equal(needWrittenUnsignedInt64WithValueLength17SymbolsChars, testUnsignedInt64ValueLength17SymbolsCharsWritten);
            Assert.True(tryWriteIn64WithValueLength17SymbolsResult);
            
            char[] testUnsignedInt64BufferWithValueLength17SymbolsAndLessNeedBuffer = new char[16];
            ulong testUnsignedInt64WithValueLength17SymbolsAndLessNeedBuffer = 98765432101234567L;
            bool tryWriteIn64WithValueLength17SymbolsAndLessNeedBufferResult = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueLength17SymbolsAndLessNeedBuffer.AsSpan(), 
                out int testUnsignedInt64ValueLength17SymbolsAndLessNeedBufferCharsWritten, testUnsignedInt64WithValueLength17SymbolsAndLessNeedBuffer);
            int needWrittenUnsignedInt64WithValueLength17SymbolsAndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenUnsignedInt64WithValueLength17SymbolsAndLessNeedBufferChars, testUnsignedInt64ValueLength17SymbolsAndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueLength17SymbolsAndLessNeedBufferResult);
            
            char[] testUnsignedInt64BufferWithValueLength16Symbols = new char[1024];
            ulong testUnsignedInt64WithValueLength16Symbols = 9876543210123456L;
            bool tryWriteIn64WithValueLength16SymbolsResult = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueLength16Symbols.AsSpan(), 
                out int testUnsignedInt64ValueLength16SymbolsCharsWritten, testUnsignedInt64WithValueLength16Symbols);
            int needWrittenUnsignedInt64WithValueLength16SymbolsChars = 16;
            Assert.Equal(needWrittenUnsignedInt64WithValueLength16SymbolsChars, testUnsignedInt64ValueLength16SymbolsCharsWritten);
            Assert.True(tryWriteIn64WithValueLength16SymbolsResult);
            
            char[] testUnsignedInt64BufferWithValueLength16SymbolsAndLessNeedBuffer = new char[15];
            ulong testUnsignedInt64WithValueLength16SymbolsAndLessNeedBuffer = 9876543210123456L;
            bool tryWriteIn64WithValueLength16SymbolsAndLessNeedBufferResult = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueLength16SymbolsAndLessNeedBuffer.AsSpan(), 
                out int testUnsignedInt64ValueLength16SymbolsAndLessNeedBufferCharsWritten, testUnsignedInt64WithValueLength16SymbolsAndLessNeedBuffer);
            int needWrittenUnsignedInt64WithValueLength16SymbolsAndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenUnsignedInt64WithValueLength16SymbolsAndLessNeedBufferChars, testUnsignedInt64ValueLength16SymbolsAndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueLength16SymbolsAndLessNeedBufferResult);
            
            char[] testUnsignedInt64BufferWithValueLength15Symbols = new char[1024];
            ulong testUnsignedInt64WithValueLength15Symbols = 987654321012345L;
            bool tryWriteIn64WithValueLength15SymbolsResult = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueLength15Symbols.AsSpan(), 
                out int testUnsignedInt64ValueLength15SymbolsCharsWritten, testUnsignedInt64WithValueLength15Symbols);
            int needWrittenUnsignedInt64WithValueLength15SymbolsChars = 15;
            Assert.Equal(needWrittenUnsignedInt64WithValueLength15SymbolsChars, testUnsignedInt64ValueLength15SymbolsCharsWritten);
            Assert.True(tryWriteIn64WithValueLength15SymbolsResult);
            
            char[] testUnsignedInt64BufferWithValueLength15SymbolsAndLessNeedBuffer = new char[14];
            ulong testUnsignedInt64WithValueLength15SymbolsAndLessNeedBuffer = 987654321012345L;
            bool tryWriteIn64WithValueLength15SymbolsAndLessNeedBufferResult = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueLength15SymbolsAndLessNeedBuffer.AsSpan(), 
                out int testUnsignedInt64ValueLength15SymbolsAndLessNeedBufferCharsWritten, testUnsignedInt64WithValueLength15SymbolsAndLessNeedBuffer);
            int needWrittenUnsignedInt64WithValueLength15SymbolsAndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenUnsignedInt64WithValueLength15SymbolsAndLessNeedBufferChars, testUnsignedInt64ValueLength15SymbolsAndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueLength15SymbolsAndLessNeedBufferResult);
            
            char[] testUnsignedInt64BufferWithValueLength14Symbols = new char[1024];
            ulong testUnsignedInt64WithValueLength14Symbols = 98765432101234L;
            bool tryWriteIn64WithValueLength14SymbolsResult = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueLength14Symbols.AsSpan(), 
                out int testUnsignedInt64ValueLength14SymbolsCharsWritten, testUnsignedInt64WithValueLength14Symbols);
            int needWrittenUnsignedInt64WithValueLength14SymbolsChars = 14;
            Assert.Equal(needWrittenUnsignedInt64WithValueLength14SymbolsChars, testUnsignedInt64ValueLength14SymbolsCharsWritten);
            Assert.True(tryWriteIn64WithValueLength14SymbolsResult);
            
            char[] testUnsignedInt64BufferWithValueLength14SymbolsAndLessNeedBuffer = new char[13];
            ulong testUnsignedInt64WithValueLength14SymbolsAndLessNeedBuffer = 98765432101234L;
            bool tryWriteIn64WithValueLength14SymbolsAndLessNeedBufferResult = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueLength14SymbolsAndLessNeedBuffer.AsSpan(), 
                out int testUnsignedInt64ValueLength14SymbolsAndLessNeedBufferCharsWritten, testUnsignedInt64WithValueLength14SymbolsAndLessNeedBuffer);
            int needWrittenUnsignedInt64WithValueLength14SymbolsAndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenUnsignedInt64WithValueLength14SymbolsAndLessNeedBufferChars, testUnsignedInt64ValueLength14SymbolsAndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueLength14SymbolsAndLessNeedBufferResult);
            
            char[] testUnsignedInt64BufferWithValueLength13Symbols = new char[1024];
            ulong testUnsignedInt64WithValueLength13Symbols = 9876543210123L;
            bool tryWriteIn64WithValueLength13SymbolsResult = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueLength13Symbols.AsSpan(), 
                out int testUnsignedInt64ValueLength13SymbolsCharsWritten, testUnsignedInt64WithValueLength13Symbols);
            int needWrittenUnsignedInt64WithValueLength13SymbolsChars = 13;
            Assert.Equal(needWrittenUnsignedInt64WithValueLength13SymbolsChars, testUnsignedInt64ValueLength13SymbolsCharsWritten);
            Assert.True(tryWriteIn64WithValueLength13SymbolsResult);
            
            char[] testUnsignedInt64BufferWithValueLength13SymbolsAndLessNeedBuffer = new char[12];
            ulong testUnsignedInt64WithValueLength13SymbolsAndLessNeedBuffer = 9876543210123L;
            bool tryWriteIn64WithValueLength13SymbolsAndLessNeedBufferResult = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueLength13SymbolsAndLessNeedBuffer.AsSpan(), 
                out int testUnsignedInt64ValueLength13SymbolsAndLessNeedBufferCharsWritten, testUnsignedInt64WithValueLength13SymbolsAndLessNeedBuffer);
            int needWrittenUnsignedInt64WithValueLength13SymbolsAndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenUnsignedInt64WithValueLength13SymbolsAndLessNeedBufferChars, testUnsignedInt64ValueLength13SymbolsAndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueLength13SymbolsAndLessNeedBufferResult);
            
            char[] testUnsignedInt64BufferWithValueLength12Symbols = new char[1024];
            ulong testUnsignedInt64WithValueLength12Symbols = 987654321012L;
            bool tryWriteIn64WithValueLength12SymbolsResult = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueLength12Symbols.AsSpan(), 
                out int testUnsignedInt64ValueLength12SymbolsCharsWritten, testUnsignedInt64WithValueLength12Symbols);
            int needWrittenUnsignedInt64WithValueLength12SymbolsChars = 12;
            Assert.Equal(needWrittenUnsignedInt64WithValueLength12SymbolsChars, testUnsignedInt64ValueLength12SymbolsCharsWritten);
            Assert.True(tryWriteIn64WithValueLength12SymbolsResult);
            
            char[] testUnsignedInt64BufferWithValueLength12SymbolsAndLessNeedBuffer = new char[11];
            ulong testUnsignedInt64WithValueLength12SymbolsAndLessNeedBuffer = 987654321012L;
            bool tryWriteIn64WithValueLength12SymbolsAndLessNeedBufferResult = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueLength12SymbolsAndLessNeedBuffer.AsSpan(), 
                out int testUnsignedInt64ValueLength12SymbolsAndLessNeedBufferCharsWritten, testUnsignedInt64WithValueLength12SymbolsAndLessNeedBuffer);
            int needWrittenUnsignedInt64WithValueLength12SymbolsAndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenUnsignedInt64WithValueLength12SymbolsAndLessNeedBufferChars, testUnsignedInt64ValueLength12SymbolsAndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueLength12SymbolsAndLessNeedBufferResult);
            
            char[] testUnsignedInt64BufferWithValueLength11Symbols = new char[1024];
            ulong testUnsignedInt64WithValueLength11Symbols = 98765432101L;
            bool tryWriteIn64WithValueLength11SymbolsResult = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueLength11Symbols.AsSpan(), 
                out int testUnsignedInt64ValueLength11SymbolsCharsWritten, testUnsignedInt64WithValueLength11Symbols);
            int needWrittenUnsignedInt64WithValueLength11SymbolsChars = 11;
            Assert.Equal(needWrittenUnsignedInt64WithValueLength11SymbolsChars, testUnsignedInt64ValueLength11SymbolsCharsWritten);
            Assert.True(tryWriteIn64WithValueLength11SymbolsResult);
            
            char[] testUnsignedInt64BufferWithValueLength11SymbolsAndLessNeedBuffer = new char[10];
            ulong testUnsignedInt64WithValueLength11SymbolsAndLessNeedBuffer = 98765432101L;
            bool tryWriteIn64WithValueLength11SymbolsAndLessNeedBufferResult = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueLength11SymbolsAndLessNeedBuffer.AsSpan(), 
                out int testUnsignedInt64ValueLength11SymbolsAndLessNeedBufferCharsWritten, testUnsignedInt64WithValueLength11SymbolsAndLessNeedBuffer);
            int needWrittenUnsignedInt64WithValueLength11SymbolsAndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenUnsignedInt64WithValueLength11SymbolsAndLessNeedBufferChars, testUnsignedInt64ValueLength11SymbolsAndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueLength11SymbolsAndLessNeedBufferResult);
            
            char[] testUnsignedInt64BufferWithValueLength10Symbols = new char[1024];
            ulong testUnsignedInt64WithValueLength10Symbols = 9876543210L;
            bool tryWriteIn64WithValueLength10SymbolsResult = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueLength10Symbols.AsSpan(), 
                out int testUnsignedInt64ValueLength10SymbolsCharsWritten, testUnsignedInt64WithValueLength10Symbols);
            int needWrittenUnsignedInt64WithValueLength10SymbolsChars = 10;
            Assert.Equal(needWrittenUnsignedInt64WithValueLength10SymbolsChars, testUnsignedInt64ValueLength10SymbolsCharsWritten);
            Assert.True(tryWriteIn64WithValueLength10SymbolsResult);
            
            char[] testUnsignedInt64BufferWithValueLength10SymbolsAndLessNeedBuffer = new char[9];
            ulong testUnsignedInt64WithValueLength10SymbolsAndLessNeedBuffer = 9876543210L;
            bool tryWriteIn64WithValueLength10SymbolsAndLessNeedBufferResult = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueLength10SymbolsAndLessNeedBuffer.AsSpan(), 
                out int testUnsignedInt64ValueLength10SymbolsAndLessNeedBufferCharsWritten, testUnsignedInt64WithValueLength10SymbolsAndLessNeedBuffer);
            int needWrittenUnsignedInt64WithValueLength10SymbolsAndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenUnsignedInt64WithValueLength10SymbolsAndLessNeedBufferChars, testUnsignedInt64ValueLength10SymbolsAndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueLength10SymbolsAndLessNeedBufferResult);
            
            char[] testUnsignedInt64BufferWithValueMore100000000 = new char[1024];
            ulong testUnsignedInt64WithValueMore100000000 = 987654321L;
            bool tryWriteIn64WithValueMore100000000Result = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueMore100000000.AsSpan(), 
                out int testUnsignedInt64ValueMore100000000CharsWritten, testUnsignedInt64WithValueMore100000000);
            int needWrittenUnsignedInt64WithValueMore100000000Chars = 9;
            Assert.Equal(needWrittenUnsignedInt64WithValueMore100000000Chars, testUnsignedInt64ValueMore100000000CharsWritten);
            Assert.True(tryWriteIn64WithValueMore100000000Result);
            
            char[] testUnsignedInt64BufferWithValueMore100000000AndLessNeedBuffer = new char[8];
            ulong testUnsignedInt64WithValueMore100000000AndLessNeedBuffer = 987654321L;
            bool tryWriteIn64WithValueMore100000000AndLessNeedBufferResult = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueMore100000000AndLessNeedBuffer.AsSpan(), 
                out int testUnsignedInt64ValueMore100000000AndLessNeedBufferCharsWritten, testUnsignedInt64WithValueMore100000000AndLessNeedBuffer);
            int needWrittenUnsignedInt64WithValueMore100000000AndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenUnsignedInt64WithValueMore100000000AndLessNeedBufferChars, testUnsignedInt64ValueMore100000000AndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueMore100000000AndLessNeedBufferResult);
            
            char[] testUnsignedInt64BufferWithValueMore10000000 = new char[1024];
            ulong testUnsignedInt64WithValueMore10000000 = 98765432L;
            bool tryWriteIn64WithValueMore10000000Result = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueMore10000000.AsSpan(), 
                out int testUnsignedInt64ValueMore10000000CharsWritten, testUnsignedInt64WithValueMore10000000);
            int needWrittenUnsignedInt64WithValueMore10000000Chars = 8;
            Assert.Equal(needWrittenUnsignedInt64WithValueMore10000000Chars, testUnsignedInt64ValueMore10000000CharsWritten);
            Assert.True(tryWriteIn64WithValueMore10000000Result);
            
            char[] testUnsignedInt64BufferWithValueMore10000000AndLessNeedBuffer = new char[7];
            ulong testUnsignedInt64WithValueMore10000000AndLessNeedBuffer = 98765432L;
            bool tryWriteIn64WithValueMore10000000AndLessNeedBufferResult = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueMore10000000AndLessNeedBuffer.AsSpan(), 
                out int testUnsignedInt64ValueMore10000000AndLessNeedBufferCharsWritten, testUnsignedInt64WithValueMore10000000AndLessNeedBuffer);
            int needWrittenUnsignedInt64WithValueMore10000000AndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenUnsignedInt64WithValueMore10000000AndLessNeedBufferChars, testUnsignedInt64ValueMore10000000AndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueMore10000000AndLessNeedBufferResult);
            
            char[] testUnsignedInt64BufferWithValueMore1000000 = new char[1024];
            ulong testUnsignedInt64WithValueMore1000000 = 9876543L;
            bool tryWriteIn64WithValueMore1000000Result = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueMore1000000.AsSpan(), 
                out int testUnsignedInt64ValueMore1000000CharsWritten, testUnsignedInt64WithValueMore1000000);
            int needWrittenUnsignedInt64WithValueMore1000000Chars = 7;
            Assert.Equal(needWrittenUnsignedInt64WithValueMore1000000Chars, testUnsignedInt64ValueMore1000000CharsWritten);
            Assert.True(tryWriteIn64WithValueMore1000000Result);
            
            char[] testUnsignedInt64BufferWithValueMore1000000AndLessNeedBuffer = new char[6];
            ulong testUnsignedInt64WithValueMore1000000AndLessNeedBuffer = 9876543L;
            bool tryWriteIn64WithValueMore1000000AndLessNeedBufferResult = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueMore1000000AndLessNeedBuffer.AsSpan(), 
                out int testUnsignedInt64ValueMore1000000AndLessNeedBufferCharsWritten, testUnsignedInt64WithValueMore1000000AndLessNeedBuffer);
            int needWrittenUnsignedInt64WithValueMore1000000AndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenUnsignedInt64WithValueMore1000000AndLessNeedBufferChars, testUnsignedInt64ValueMore1000000AndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueMore1000000AndLessNeedBufferResult);
            
            char[] testUnsignedInt64BufferWithValueMore100000 = new char[1024];
            ulong testUnsignedInt64WithValueMore100000 = 987654L;
            bool tryWriteIn64WithValueMore100000Result = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueMore100000.AsSpan(), 
                out int testUnsignedInt64ValueMore100000CharsWritten, testUnsignedInt64WithValueMore100000);
            int needWrittenUnsignedInt64WithValueMore100000Chars = 6;
            Assert.Equal(needWrittenUnsignedInt64WithValueMore100000Chars, testUnsignedInt64ValueMore100000CharsWritten);
            Assert.True(tryWriteIn64WithValueMore100000Result);
            
            char[] testUnsignedInt64BufferWithValueMore100000AndLessNeedBuffer = new char[5];
            ulong testUnsignedInt64WithValueMore100000AndLessNeedBuffer = 987654L;
            bool tryWriteIn64WithValueMore100000AndLessNeedBufferResult = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueMore100000AndLessNeedBuffer.AsSpan(), 
                out int testUnsignedInt64ValueMore100000AndLessNeedBufferCharsWritten, testUnsignedInt64WithValueMore100000AndLessNeedBuffer);
            int needWrittenUnsignedInt64WithValueMore100000AndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenUnsignedInt64WithValueMore100000AndLessNeedBufferChars, testUnsignedInt64ValueMore100000AndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueMore100000AndLessNeedBufferResult);
            
            char[] testUnsignedInt64BufferWithValueMore10000 = new char[1024];
            ulong testUnsignedInt64WithValueMore10000 = 98765L;
            bool tryWriteIn64WithValueMore10000Result = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueMore10000.AsSpan(), 
                out int testUnsignedInt64ValueMore10000CharsWritten, testUnsignedInt64WithValueMore10000);
            int needWrittenUnsignedInt64WithValueMore10000Chars = 5;
            Assert.Equal(needWrittenUnsignedInt64WithValueMore10000Chars, testUnsignedInt64ValueMore10000CharsWritten);
            Assert.True(tryWriteIn64WithValueMore10000Result);
            
            char[] testUnsignedInt64BufferWithValueMore10000AndLessNeedBuffer = new char[4];
            ulong testUnsignedInt64WithValueMore10000AndLessNeedBuffer = 98765L;
            bool tryWriteIn64WithValueMore10000AndLessNeedBufferResult = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueMore10000AndLessNeedBuffer.AsSpan(), 
                out int testUnsignedInt64ValueMore10000AndLessNeedBufferCharsWritten, testUnsignedInt64WithValueMore10000AndLessNeedBuffer);
            int needWrittenUnsignedInt64WithValueMore10000AndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenUnsignedInt64WithValueMore10000AndLessNeedBufferChars, testUnsignedInt64ValueMore10000AndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueMore10000AndLessNeedBufferResult);

            char[] testUnsignedInt64BufferWithValueLess10000AndEmptyBuffer = Array.Empty<char>();
            ulong testUnsignedInt64WithValueLess10000AndEmptyBuffer = 9876L;
            bool tryWriteIn64WithValueLess10000AndEmptyBufferResult = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueLess10000AndEmptyBuffer.AsSpan(), 
                out int testUnsignedInt64ValueLess10000AndEmptyBufferCharsWritten, testUnsignedInt64WithValueLess10000AndEmptyBuffer);
            int needWrittenUnsignedInt64WithValueLess10000AndEmptyBufferChars = 0;
            Assert.Equal(needWrittenUnsignedInt64WithValueLess10000AndEmptyBufferChars, testUnsignedInt64ValueLess10000AndEmptyBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueLess10000AndEmptyBufferResult);
            
            char[] testUnsignedInt64BufferWithValueLess10000 = new char[1024];
            ulong testUnsignedInt64WithValueLess10000 = 9876L;
            bool tryWriteIn64WithValueLess10000Result = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueLess10000.AsSpan(), 
                out int testUnsignedInt64ValueLess10000CharsWritten, testUnsignedInt64WithValueLess10000);
            int needWrittenUnsignedInt64WithValueLess10000Chars = 4;
            Assert.Equal(needWrittenUnsignedInt64WithValueLess10000Chars, testUnsignedInt64ValueLess10000CharsWritten);
            Assert.True(tryWriteIn64WithValueLess10000Result);
            
            char[] testUnsignedInt64BufferWithValueLess1000 = new char[1024];
            ulong testUnsignedInt64WithValueLess1000 = 987L;
            bool tryWriteIn64WithValueLess1000Result = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueLess1000.AsSpan(), 
                out int testUnsignedInt64ValueLess1000CharsWritten, testUnsignedInt64WithValueLess1000);
            int needWrittenUnsignedInt64WithValueLess1000Chars = 3;
            Assert.Equal(needWrittenUnsignedInt64WithValueLess1000Chars, testUnsignedInt64ValueLess1000CharsWritten);
            Assert.True(tryWriteIn64WithValueLess1000Result);
            
            char[] testUnsignedInt64BufferWithValueLess1000AndLessNeedBuffer = new char[2];
            ulong testUnsignedInt64WithValueLess1000AndLessNeedBuffer = 987L;
            bool tryWriteIn64WithValueLess1000AndLessNeedBufferResult = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueLess1000AndLessNeedBuffer.AsSpan(), 
                out int testUnsignedInt64ValueLess1000AndLessNeedBufferCharsWritten, testUnsignedInt64WithValueLess1000AndLessNeedBuffer);
            int needWrittenUnsignedInt64WithValueLess1000AndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenUnsignedInt64WithValueLess1000AndLessNeedBufferChars, testUnsignedInt64ValueLess1000AndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueLess1000AndLessNeedBufferResult);
            
            char[] testUnsignedInt64BufferWithValueLess100 = new char[1024];
            ulong testUnsignedInt64WithValueLess100 = 98L;
            bool tryWriteIn64WithValueLess100Result = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueLess100.AsSpan(), 
                out int testUnsignedInt64ValueLess100CharsWritten, testUnsignedInt64WithValueLess100);
            int needWrittenUnsignedInt64WithValueLess100Chars = 2;
            Assert.Equal(needWrittenUnsignedInt64WithValueLess100Chars, testUnsignedInt64ValueLess100CharsWritten);
            Assert.True(tryWriteIn64WithValueLess100Result);
            
            char[] testUnsignedInt64BufferWithValueLess100AndLessNeedBuffer = new char[1];
            ulong testUnsignedInt64WithValueLess100AndLessNeedBuffer = 98L;
            bool tryWriteIn64WithValueLess100AndLessNeedBufferResult = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueLess100AndLessNeedBuffer.AsSpan(), 
                out int testUnsignedInt64ValueLess100AndLessNeedBufferCharsWritten, testUnsignedInt64WithValueLess100AndLessNeedBuffer);
            int needWrittenUnsignedInt64WithValueLess100AndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenUnsignedInt64WithValueLess100AndLessNeedBufferChars, testUnsignedInt64ValueLess100AndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueLess100AndLessNeedBufferResult);
            
            char[] testUnsignedInt64BufferWithValueLess10 = new char[1024];
            ulong testUnsignedInt64WithValueLess10 = 9L;
            bool tryWriteIn64WithValueLess10Result = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueLess10.AsSpan(), 
                out int testUnsignedInt64ValueLess10CharsWritten, testUnsignedInt64WithValueLess10);
            int needWrittenUnsignedInt64WithValueLess10Chars = 1;
            Assert.Equal(needWrittenUnsignedInt64WithValueLess10Chars, testUnsignedInt64ValueLess10CharsWritten);
            Assert.True(tryWriteIn64WithValueLess10Result);
            
            char[] testUnsignedInt64BufferWithValueLess10AndLessNeedBuffer = Array.Empty<char>();
            ulong testUnsignedInt64WithValueLess10AndLessNeedBuffer = 9L;
            bool tryWriteIn64WithValueLess10AndLessNeedBufferResult = NumberWriter.TryWriteUInt64(testUnsignedInt64BufferWithValueLess10AndLessNeedBuffer.AsSpan(), 
                out int testUnsignedInt64ValueLess10AndLessNeedBufferCharsWritten, testUnsignedInt64WithValueLess10AndLessNeedBuffer);
            int needWrittenUnsignedInt64WithValueLess10AndLessNeedBufferChars = 0;
            Assert.Equal(needWrittenUnsignedInt64WithValueLess10AndLessNeedBufferChars, testUnsignedInt64ValueLess10AndLessNeedBufferCharsWritten);
            Assert.False(tryWriteIn64WithValueLess10AndLessNeedBufferResult);
            
            char[] testUnsignedInt64WithEmptyBuffer = Array.Empty<char>();
            ulong testUnsignedInt64ValueWithEmptyBuffer = 123456789L;
            bool tryWriteIn64WithEmptyBufferResult = NumberWriter.TryWriteUInt64(
                testUnsignedInt64WithEmptyBuffer.AsSpan(), 
                out int testUnsignedInt64WithEmptyBufferCharsWritten, testUnsignedInt64ValueWithEmptyBuffer);
            int needWrittenUnsignedInt64WithEmptyBufferChars = 0;
            Assert.Equal(needWrittenUnsignedInt64WithEmptyBufferChars, testUnsignedInt64WithEmptyBufferCharsWritten);
            Assert.False(tryWriteIn64WithEmptyBufferResult);
            
            // char[] testMinValueUnsignedInt64Buffer = new char[1024];
            // ulong testMinValueUnsignedInt64Value = ulong.MinValue;
            // bool tryWriteMinValueIn64Result = NumberWriter.TryWriteUInt64(testMinValueUnsignedInt64Buffer.AsSpan(), 
            //     out int testMinValueUnsignedInt64CharsWritten, testMinValueUnsignedInt64Value);
            // int needWrittenMinValueUnsignedInt64Chars = 20;
            // Assert.Equal(needWrittenMinValueUnsignedInt64Chars, testMinValueUnsignedInt64CharsWritten);
            // Assert.True(tryWriteMinValueIn64Result);

            char[] testMinValueUnsignedInt64AndEmptyBuffer = Array.Empty<char>();
            ulong testMinValueUnsignedInt64ValueAndEmptyBuffer = ulong.MinValue;
            bool tryWriteMinValueWithAndEmptyBufferIn64Result = 
                NumberWriter.TryWriteUInt64(testMinValueUnsignedInt64AndEmptyBuffer.AsSpan(), 
                out int testMinValueWithAndEmptyBufferUnsignedInt64CharsWritten, testMinValueUnsignedInt64ValueAndEmptyBuffer);
            int needWrittenMinValueWithAndEmptyBufferUnsignedInt64Chars = 0;
            Assert.Equal(needWrittenMinValueWithAndEmptyBufferUnsignedInt64Chars, testMinValueWithAndEmptyBufferUnsignedInt64CharsWritten);
            Assert.False(tryWriteMinValueWithAndEmptyBufferIn64Result);
            
            char[] testMaxValueUnsignedInt64Buffer = new char[1024];
            ulong testMaxValueUnsignedInt64Value = long.MaxValue;
            bool tryWriteMaxValueIn64Result = NumberWriter.TryWriteUInt64(testMaxValueUnsignedInt64Buffer.AsSpan(), 
                out int testMaxValueUnsignedInt64CharsWritten, testMaxValueUnsignedInt64Value);
            int needWrittenMaxValueUnsignedInt64Chars = 19;
            Assert.Equal(needWrittenMaxValueUnsignedInt64Chars, testMaxValueUnsignedInt64CharsWritten);
            Assert.True(tryWriteMaxValueIn64Result);
            
            char[] testMaxValueUnsignedInt64AndLessNeedBuffer = Array.Empty<char>();
            ulong testMaxValueUnsignedInt64AndLessNeedBufferValue = long.MaxValue;
            bool tryWriteMaxValueAndLessNeedBufferIn64Result = 
                NumberWriter.TryWriteUInt64(testMaxValueUnsignedInt64AndLessNeedBuffer.AsSpan(), 
                    out int testMaxValueAndLessNeedBufferUnsignedInt64CharsWritten, testMaxValueUnsignedInt64AndLessNeedBufferValue);
            int needWrittenMaxValueAndLessNeedBufferUnsignedInt64Chars = 0;
            Assert.Equal(needWrittenMaxValueAndLessNeedBufferUnsignedInt64Chars, testMaxValueAndLessNeedBufferUnsignedInt64CharsWritten);
            Assert.False(tryWriteMaxValueAndLessNeedBufferIn64Result);
        }
    }
}